// HSS.Forms.AppDataChangingEventArgs.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.html
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2010
// ----------------------------------------------------------------------------
// File:       AppDataChangingEventArgs.cs
// Author:     HSS\gbanta
// Created:    08/12/2010
// Modified:   12/04/2010
// ----------------------------------------------------------------------------
namespace HSS.Forms
{
	#region Using Directives

	#endregion

	#region AppDataChangingEventArgs
	/// <summary>
	/// EventArgs class to be passed as the parameter of a AppData.Changing event handler.
	/// </summary>
	/// <remarks>
	/// This class provides all the information relevant to the change about to be made to the AppData.
	/// Besides the properties of AppDataChangedArgs, it adds the Cancel property which allows the 
	/// event handler to prevent the change from happening.
	/// </remarks>
	/// <seealso cref="AppDataChangedEventArgs" />
	public class AppDataChangingEventArgs : AppDataChangedEventArgs
	{
		/// <summary>
		/// Initializes a new instance of the AppDataChangingEventArgs class by initializing all of its properties.
		/// </summary>
		/// <param name="appData">The Application Data that was changed</param>
		/// <param name="key">The key used to reference the AppData</param>
		/// <param name="oldValue">The old value</param>
		/// <param name="newValue">The new value</param>
		public AppDataChangingEventArgs(AppData appData, string key, object oldValue, object newValue)
			: base(appData, key, oldValue, newValue)
		{
		}

		/// <summary>
		/// Gets or sets whether the change about to be made should be canceled or not.
		/// </summary>
		/// <remarks> 
		/// By default this property is set to false, meaning that the change is allowed.
		/// </remarks>
		public bool Cancel
		{
			get { return this._cancel; }
			set { this._cancel = value; }
		} bool _cancel;
	}
	#endregion
}